<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<p>The socket package provides interface ala {@link java.net.Socket}
over JXTA pipes. Since the PipeService provides uni-directional, and
unreliable communication channels, the JxtaSocket employs it's own
protocol over pipes to establish bi-directional connections for every
request. In addition the JxtaSocket also employs the reliability
library to ensure reliable delivery of data.&nbsp; Another feature of
JxtaSockets is chunking, which relieves applications from having to
worry about mtu size, just remember to invoke flush at the end of data
transmission<br>
</p>
<p><br>
</p>
<p>JxtaSocket defines the following message elements employed during
the life cycle of a JxtaSocket :<br>
</p>
<div style="margin-left: 40px;"><><span style="color: rgb(51, 51, 255);">
&lt;Cred&gt;</span>Credentials to determine trust<span
 style="color: rgb(51, 51, 255);">&lt;/Cred&gt;</span></><br>
<><span style="color: rgb(51, 51, 255);">&lt;reqPipe&gt;</span>requestor's
pipe advertisement<span style="color: rgb(51, 51, 255);">&lt;/reqPipe&gt;</span></><br>
<span style="color: rgb(51, 51, 255);">&lt;remPipe&gt;</span>Remote
pipe advertisement<span style="color: rgb(51, 51, 255);">&lt;/remPipe&gt;</span><br>
<span style="color: rgb(51, 51, 255);">&lt;reqPeer&gt;</span>Remote
peer advertisement<span style="color: rgb(51, 51, 255);">&lt;/remPeer&gt;</span><br>
<span style="color: rgb(51, 51, 255);">&lt;stream&gt;</span>true|false
== reliable|or not<span style="color: rgb(51, 51, 255);">&lt;/stream&gt;</span><br>
<span style="color: rgb(51, 51, 255);">&lt;close&gt;</span>close request<span
 style="color: rgb(51, 51, 255);">&lt;/close&gt;<br>
</span><span style="color: rgb(51, 51, 255);">&lt;closeACK&gt;</span>ack
close request<span style="color: rgb(51, 51, 255);">&lt;/closeACK&gt;</span><span
 style="color: rgb(51, 51, 255);"></span><br>
<span style="color: rgb(51, 51, 255);">&lt;data&gt;</span>data<span
 style="color: rgb(51, 51, 255);">&lt;/data&gt;</span><br>
</div>
<p>The socket package also provides interface ala {@link
java.net.MulticastSocket} over propagated pipes.&nbsp; Keep in mind
JxtaMulticastSocket does not provide chunking nor reliability at this
time, therefore one must consider configuration parameters such as the
multicast datagram size defined in the PlatformConfig :<br>
</p>
<div style="margin-left: 80px;"><span style="color: rgb(51, 51, 255);">&lt;MulticastSize&gt;</span><br>
&nbsp;&nbsp;&nbsp; 16384<br>
<span style="color: rgb(51, 51, 255);">&lt;/MulticastSize&gt;</span><br>
</div>
<p>As well as any other mtu size imposed by the JXTA Platform, or the
operating system.<br>
</p>
<p>For examples on how to utilize the net.jxta.socket see the online
tutorials on <a
 href="http://platform.jxta.org/source/browse/platform/www/java/tutorial/examples/socket">JxtaSocket</a>,
and <a
 href="http://platform.jxta.org/source/browse/platform/www/java/tutorial/examples/multicast">JxtaMulticastSocket</a>
available at <a href="http://www.jxta.org/Tutorials.html">http://www.jxta.org/Tutorials.html</a><br>
</p>
<p><br>
</p>
</body>
</html>
